package manterAluguel;

import java.awt.Font;
import java.awt.TextField;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.table.DefaultTableModel;

import inicio.PainelGeral;

public class PainelCadastrarAluguel extends PainelGeral {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private JTextField txIdAluguel;
	private JTextField txDataAluguel;
	private JTextField txHoraAluguel;
	private JTextField txRuaAluguel;
	private JTextField txNumeroAluguel;
	private JTextField txBairroAluguel;
	private JTextField txCidadeAluguel;
	
	private JLabel lbIdAluguel;
	private JLabel lbDataAluguel;
	private JLabel lbHoraAluguel;
	private JLabel lbRuaAluguel;
	private JLabel lbNumeroAluguel;
	private JLabel lbBairroAluguel;
	private JLabel lbCidadeAluguel;

	private Font fonteGeral;
	private JTable table;
	private JButton btOk;
	
	
	public PainelCadastrarAluguel(){
		
		 this.txIdAluguel = new JTextField();
		 this.txDataAluguel = new JTextField();
		 this.txHoraAluguel = new JTextField();
		 this.txRuaAluguel = new JTextField();
		 this.txNumeroAluguel = new JTextField();
		 this.txBairroAluguel = new JTextField();
		 this.txCidadeAluguel = new JTextField();
		
		 this.lbIdAluguel = new JLabel("ID:");
		 this.lbDataAluguel = new JLabel("Data:");
		 this.lbHoraAluguel = new JLabel("Hora:");
		 this.lbRuaAluguel = new JLabel("Rua:");
		 this.lbNumeroAluguel = new JLabel("Numero");
		
		 this.lbBairroAluguel = new JLabel("Bairro");
		 this.lbCidadeAluguel = new JLabel("Cidade:");
		
		
		
		this.btOk = new JButton("Cadastrar");
		this.btOk.setFont(fonteGeral);
	
		 this.lbIdAluguel.setFont(fonteGeral);
		 this.lbDataAluguel.setFont(fonteGeral);
		 this.lbHoraAluguel.setFont(fonteGeral);
		 this.lbRuaAluguel.setFont(fonteGeral);
		 this.lbNumeroAluguel.setFont(fonteGeral);
		 
		 this.lbBairroAluguel.setFont(fonteGeral);
		 this.lbCidadeAluguel.setFont(fonteGeral);
		

		
		this.add(btOk).setBounds(648, 110, 93, 25);
		
		this.add(lbIdAluguel).setBounds(40, 40, 20, 25);
		this.add(lbDataAluguel).setBounds(90, 40, 120, 25);
		this.add(lbHoraAluguel).setBounds(180, 40, 80, 25);
		this.add(lbRuaAluguel).setBounds(260, 40, 120, 25);
		this.add(lbNumeroAluguel).setBounds(420, 40, 120, 25);
		
		this.add(lbBairroAluguel).setBounds(510, 40, 70, 25);
		this.add(lbCidadeAluguel).setBounds(670, 40, 120, 25);
		
		
		
		this.add(txIdAluguel).setBounds(40, 70, 30, 25);
		this.add(txDataAluguel).setBounds(90, 70, 70, 25);
		this.add(txHoraAluguel).setBounds(180, 70, 60, 25);
		this.add(txRuaAluguel).setBounds(260, 70, 140, 25);
		this.add(txNumeroAluguel).setBounds(420, 70, 70, 25);
		
		this.add(txBairroAluguel).setBounds(510, 70, 140, 25);
		this.add(txCidadeAluguel).setBounds(670, 70, 70, 25);
		
		
		
//		this.add(cadastrarItem).setBounds(700, 70, 70, 25);
	
		//criando a table e adicionando
		this.table = new JTable();
		 
		this.table.setModel(new DefaultTableModel(
				new Object [][]
				    {
						{null,null},
						{null,null},
						{null,null},
						{null,null},
						
				    },
				new String[] {"","","","",""}
		
					));
		
		//adicionar table no panel
		this.add(table).setBounds(10, 150, 750, 318);
		
	
		
		System.out.println("Entrou aqui PainelCadastrarAluguel");

		
		btOk.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
//				PainelCadastrarItem.this.remove(lbNomeItem);
				System.out.println("Cadastrado!");
				
			}
		});
	}
}
	

